<link rel="stylesheet" type="text/css" href="/static/css/pc/index.css" />
<link rel="stylesheet" href="/static/css/pc/common.less" />
<link rel="stylesheet/less" type="text/css" href="/static/css/pc/index.less">
<style type="text/css">
    ul {
        list-style: none !important;
    }

    p {
        margin: 0 0 1px !important;
    }

    .brand-list li {
        margin: 12.5px 10.5px !important;
    }

    .buy-btn {
        font-size: 14px;
        width: 118px;
        height: 34px;
        line-height: 34px;
        border-radius: 18px;
        background: #488DFB;
        color: #fff;
        transition: all 0.5s;
        display: block;
        margin: 0 auto;
        border: 1px solid #488DFB;
        text-align: center;
    }
</style>
<div class="content" id="content" val="7">
    <div class="container">
        <div class="category-block clearfix">
            <div class="title-contianer">
                <h2 class="title anchor" id="ProtectionCleaning">个护清洁<span class="desc">Protection&Cleaning</span></h2>
                <ul class="category-list clearfix">
                    <li class="item">
                        <a href="#">磨毛套件</a>
                    </li>
                    <li class="item">
                        <a href="#">羽绒厚被</a>
                    </li>
                    <li class="item">
                        <a href="#">绒暖布艺</a>
                    </li>
                    <li class="item">
                        <a href="#">床品套件</a>
                    </li>
                    <li class="item">
                        <a href="#">被枕垫褥</a>
                    </li>
                    <li class="item">
                        <a href="#">布艺软装</a>
                    </li>
                    <li class="item">
                        <a href="#">毛巾浴巾</a>
                    </li>
                </ul>
            </div>
            <div class="digital-list">
                <div class="banner">
                    <a href="#">
                        <div class="overflow-hidden">
                            <img class="img-scale" src="/static/images/pc/52.png">
                        </div>
                    </a>
                </div>
                <ul class="goods-list clearfix">
                    <li class="goods">
                        <div style="margin: 0 0 2px -22px;width: 184px;height:240px">
                            <div style="z-index: 999;position: relative;top: 105px;height: 0;">
                                <a class="buy-btn" val="1" name="checkProduct">点击选择1</a>
                            </div>
                            <img src="/static/images/background.png" style="width: 184px;height:240px">
                        </div>
                    </li>
                    <li class="goods">
                        <div style="margin: 0 0 2px -22px;width: 184px;height:240px">
                            <div style="z-index: 999;position: relative;top: 105px;height: 0;">
                                <a class="buy-btn" val="2" name="checkProduct">点击选择2</a>
                            </div>
                            <img src="/static/images/background.png" style="width: 184px;height:240px">
                        </div>
                    </li>
                    <li class="goods">
                        <div style="margin: 0 0 2px -22px;width: 184px;height:240px">
                            <div style="z-index: 999;position: relative;top: 105px;height: 0;">
                                <a class="buy-btn" val="3" name="checkProduct">点击选择3</a>
                            </div>
                            <img src="/static/images/background.png" style="width: 184px;height:240px">
                        </div>
                    </li>
                    <li class="goods">
                        <div style="margin: 0 0 2px -22px;width: 184px;height:240px">
                            <div style="z-index: 999;position: relative;top: 105px;height: 0;">
                                <a class="buy-btn" val="4" name="checkProduct">点击选择4</a>
                            </div>
                            <img src="/static/images/background.png" style="width: 184px;height:240px">
                        </div>
                    </li>
                    <li class="goods">
                        <div style="margin: 0 0 2px -22px;width: 184px;height:240px">
                            <div style="z-index: 999;position: relative;top: 105px;height: 0;">
                                <a class="buy-btn" val="5" name="checkProduct">点击选择5</a>
                            </div>
                            <img src="/static/images/background.png" style="width: 184px;height:240px">
                        </div>
                    </li>
                    <li class="goods">
                        <div style="margin: 0 0 2px -22px;width: 184px;height:240px">
                            <div style="z-index: 999;position: relative;top: 105px;height: 0;">
                                <a class="buy-btn" val="6" name="checkProduct">点击选择6</a>
                            </div>
                            <img src="/static/images/background.png" style="width: 184px;height:240px">
                        </div>
                    </li>
                </ul>
                <div class="rank-block">
                    <h3 class="title">今日排行榜</h3>
                    <ul class="rank-list">
                        <li class="goods">
                            <div style="margin: 0 0 2px -22px;width: 310px;height:80px">
                                <div style="z-index: 999;position: relative;top: 25px;height: 0;">
                                    <a class="buy-btn" val="7" name="checkProduct">点击选择7</a>
                                </div>
                                <img src="/static/images/background.png" style="width: 310px;height:80px">
                            </div>
                        </li>
                        <li class="goods">
                            <div style="margin: 0 0 2px -22px;width: 310px;height:80px">
                                <div style="z-index: 999;position: relative;top: 25px;height: 0;">
                                    <a class="buy-btn" val="8" name="checkProduct">点击选择8</a>
                                </div>
                                <img src="/static/images/background.png" style="width: 310px;height:80px">
                            </div>
                        </li>
                        <li class="goods">
                            <div style="margin: 0 0 2px -22px;width: 310px;height:80px">
                                <div style="z-index: 999;position: relative;top: 25px;height: 0;">
                                    <a class="buy-btn" val="9" name="checkProduct">点击选择9</a>
                                </div>
                                <img src="/static/images/background.png" style="width: 310px;height:80px">
                            </div>
                        </li>
                        <li class="goods">
                            <div style="margin: 0 0 2px -22px;width: 310px;height:80px">
                                <div style="z-index: 999;position: relative;top: 25px;height: 0;">
                                    <a class="buy-btn" val="10" name="checkProduct">点击选择10</a>
                                </div>
                                <img src="/static/images/background.png" style="width: 310px;height:80px">
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 编辑 Modal -->
<!-- <div class="modal hide fade" id="checkProductInfoByName" style="width: 700px;" tabindex="-1" role="dialog">
    <div class="modal-header">
        <button class="close" type="button" data-dismiss="modal">×</button>
        <h3 id="addRoleModalLabel">选择商品信息</h3>
    </div>
    <div class="modal-body">
        <form id="dataForm" class="definewidth m20" enctype="multipart/form-data">
            <input type="hidden" id="id"/>
            <input type="hidden" id="config_id"/>
            <table class="table table-bordered table-hover definewidth m10">
                <tr>
                    <td style="width: 25%;" class="tableleft">商品名称</td>
                    <td style="width: 63%;">
                        <input type="text" id="productName" style="width: 300px;" class="required-control"/>
                        <span style="color:red;">*</span>
                    </td>
                    <td>
                        <a href="javascript:void(0);" id="queryProductInfo" class="btn btn-primary">查询</a>
                    </td>
                </tr>
            </table>
        </form>
        <table id="taskList_table" class="table table-bordered table-hover definewidth">

        </table>
    </div>
    <div class="modal-footer">
        <a href="javascript:$('.required-control').each(function(){$(this).css('border','1px solid #ccc');$(this).attr('placeholder','');});$('#checkProductInfoByName').modal('hide');$('#dataForm')[0].reset();"
           class="btn">关闭</a>
        <a href="javascript:void(0);" id="doSaveProduct" class="btn btn-primary">保存</a>
    </div>
</div>
<script type="text/javascript" src="/static/js/lib/pcIndex.js"></script>
<script type="text/javascript">
    _function.queryUserInfo({t:'indexProductConfig',config_id:$('#content').attr('val')},function (data) {
        if(null!=data && null!=data.products_id){
            var produsts=JSON.parse(data.products_id);
            if(null!=produsts && produsts.length>0){
                $.each(produsts,function (index,val) {
                    $(".buy-btn[val="+val.id+"]").text('点击修改'+val.id).css('background-color','red').css('border','1px solid red');
                });
            }
        }
    })
    var columns = [{
        field: 'id',
        title: '选择',
        width: '50',
        align: 'center',
        formatter: function(value, row, index) {
            return '<input type="checkbox" name="checkProductId" value="' + value + '"/>';
        }
    },{
        field: 'name',
        title: '商品名称',
        align: 'center'
    },{
        field: 'shopname',
        title: '所属店铺',
        align: 'center'
    },
        {
            field: 'price',
            title: '所属价格',
            align: 'center'
        },
        {
            field: 'status',
            title: '状态',
            align: 'center',
            formatter:function(value,row,index){
                if(value==0){
                    return '上架'
                }else{
                    return '下架';
                }
            }
        }];
    // 渲染table
    initTablePage({t:'product',sqlCount:'queryListPageCount'},{column:columns});
    //点击选择
    $("a[name='checkProduct']").click(function(){
        $("#id").val($(this).attr('val'));
        $("#checkProductInfoByName").modal("show");
    });
    //查询
    $("#queryProductInfo").click(function () {
        initTablePage({t:'product',sqlCount:'queryListPageCount',name:$("#productName").val()},{column:columns});
    });
    //保存
    $("#doSaveProduct").click(function () {
        if($('input[name="checkProductId"]:checked').length>1){
            alert_msg("只能选择一条");
            return false;
        }
        _function.queryUserInfo({t:'indexProductConfig',config_id:$('#content').attr('val')},function (data) {
            if(null!=data){
                if(null!=data && null!=data.products_id){
                    var produstArray=JSON.parse(data.products_id);
                    $('input[name="checkProductId"]:checked').each(function(index, val) {
                        var requData=$(this).val();
                        var flg=true;
                        $.each(produstArray,function (index,val) {
                            if(val.id==$('#id').val()){
                                flg=false;
                                val.product_id=requData;
                                return false;
                            }else{
                                flg=true;
                                return true;
                            }
                        })
                        if(flg){
                            var produsts={};
                            produsts.id=$('#id').val();
                            produsts.product_id=$(this).val();
                            produstArray.push(produsts);
                        }
                    });
                    _function.editUserInfo({t:'indexProductConfig',id:data.id,config_id:$('#content').attr('val'),products_id:JSON.stringify(produstArray)},function (data) {
                        $(".buy-btn[val="+$('#id').val()+"]").text('点击修改'+$('#id').val()).css('background-color','red').css('border','1px solid red');
                        $("#checkProductInfoByName").modal("hide");
                    })
                }
            }else{
                var array=[];
                $('input[name="checkProductId"]:checked').each(function(index, val) {
                    var produsts={};
                    produsts.id=$('#id').val();
                    produsts.product_id=$(this).val();
                    array.push(produsts);
                });
                _function.editUserInfo({t:'indexProductConfig',config_id:$('#content').attr('val'),products_id:JSON.stringify(array)},function (data) {
                    $(".buy-btn[val="+$('#id').val()+"]").text('点击修改'+$('#id').val()).css('background-color','red').css('border','1px solid red');
                    $("#checkProductInfoByName").modal("hide");
                })
            }
        });
    });
</script> -->
